package org.linlinjava.litemall.db.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.linlinjava.litemall.db.handler.StringListTypeHandler;

import java.time.LocalDateTime;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "lumiere_coupon_grant_log",autoResultMap = true)
@Builder
public class LumiereCouponGrantLog {

    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long strategyId;

    private String strategyName;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long couponId;

    private Integer createId;

    private Integer num;

    private String cause;

    private Integer aim;

    @TableField(typeHandler = StringListTypeHandler.class)
    private List<String>aimName;

    private LocalDateTime addTime;

    private LocalDateTime updateTime;

    @TableLogic
    private Boolean deleted;

    @TableField(exist = false)
    private String couponName;

    @TableField(exist = false)
    private String createName;

}
